Page({
  data: {
    location: {},
    polyline: [],
    markers: []
  },

  onLoad(options) {
    const start = JSON.parse(options.start)
    const end = JSON.parse(options.end)
    this.setData({
      location: start,
      polyline:  [{
        points: [start, end],
        color: '#FF0000DD',
        width: 4,
        dottedLine: true,
        arrowLine: true
      }],
      markers: [
        {
          ...start,
          label: {
            content: '起点',
            fontSize: 16,
            color: '#f00',
            anchorX: -12,
            anchorY: -56
          }
        },
        {
          ...end,
          label: {
            content: '终点',
            fontSize: 16,
            color: '#f00',
            anchorX: -12,
            anchorY: -56
          }
        }
    ]
    })
  },
})
